<div class="rev-list">
    <ul>
                        <#list page.content as p>
                        <li class="rev-item comment-item clearfix">
                            <div class="user"><a class="avatar" href="/u/52068941.html" target="_blank"><img
                                    src="${p.headUrl!}"
                                    width="48" height="48"></a><span class="level">LV.${p.level!}</span></div>
                            </a>
                            <a class="name" href="/u/52068941.html" target="_blank">${p.username}</a>
                            <span class="s-star s-star${p.star}"></span>
                            <p class="rev-txt">
                                ${p.content}
                            </p>
                        <#--评论图片-->
                            <div class="rev-img">
                                <a href="/photo/poi/25091_440424016.html" target="_blank">
                                    <#if (p.commentUrl?size>0)>
                                        <#list p.commentUrl as comUrls>
                                            <img src="${comUrls}" style="width: 130px;height:130px">
                                        </#list>
                                    </#if>
                            </div>
                            <br>
                            <div class="info clearfix">
                                <a class="btn-comment _j_comment" title="添加评论" onclick="onComment()">评论</a>
                                <span class="time">${p.createTime?string("yyyy-MM-dd HH:mm:ss")}</span>
                                <span class="from">
                               </a>
                            </span>
                            </div>

                            <script>
                                function onComment() {
                                    console.log($(".replys").css("display"));
                                    var i = $(".replys").css("display")
                                    if(i =='none'){
                                        $('.replys').css({'display':'block'});
                                    }else{
                                        $('.replys').hide();
                                    }
                                }
                            </script>

                            <div class="comment add-reply ">
                                <ul class="more_reply_box comment_list">
                                <#--如果回复有数据才显示评论-->
                                    <#if p.replay??>
                                        <#list p.replay as re>
                                    <li>
                                        <a href="/u/63107989.html" target="_blank">
                                            <img src="${re.form.headUrl!}"
                                                 width="16" height="16">${(re.form.username)!}
                                        </a>
                                        </a>

                                        ${(re.content)!}
                                        <script>
                                            //回复景点的评论
                                            function AonReplay${re_index+1}() {
                                                console.log($(".re_reply${re_index+1}").data(("objectid")))
                                                alert($(".re_reply${re_index+1}").data("objectid"))
                                                var i = $(".replys").css("display")
                                                if(i =='none'){
                                                    $('.replys').css({'display':'block'});
                                                }else{
                                                    $('.replys').hide();
                                                }
                                                $(".comment_reply${p_index+1}").data("formObjectId",$(".re_reply${re_index+1}").data("objectId"))
                                                $(".comment_reply${p_index+1}").data("parent_id",$(".re_reply${re_index+1}").data("id"))
                                                $(".comment_reply${p_index+1}").data("parent_uid",$(".re_reply${re_index+1}").data("uid"))
                                                $(".comment_reply${p_index+1}").data("parent_username",$(".re_reply${re_index+1}").data("username"))
                                                /*   * @param pid 一级评论 ObjectId
                                                       * @param puserId  一级评论的用户id
                                                       * @param pusername 一级评论的用户名*/
                                            }
                                        </script>
                                        <br><span class="time">${(re.createTime?string("yyyy-MM-dd HH:mm:ss"))!}</span>
                                    </li>
                                        </#list>
                                    </#if>
                                </ul>
                                <div class="add-comment hide reply-form replys" style="display: none">
                                    <textarea class="comment_reply${p_index+1}" data-comment_id="${(userInfo.id)!}"
                                              data-formObjectId =""
                                              data-comment_username="${(userInfo.nickname)!}" data-poi_id="${(p.attrId)!}" data-poi_name="${(p.attrTitle)!}"
                                              data-parent_id="${(p.id)!}" data-parent_uid="${(p.userId)!}" data-parent_username="${(p.username)!}"
                                              style="overflow: hidden; color: rgb(204, 204, 204);" placeholder="发表评论" ></textarea>
                                    <a class="btn btn_submit_reply${p_index+1}">回复</a>
                                </div>
                                <script>
                                    //评论景点
                                    $(".btn_submit_reply${p_index+1}").click(function () {

                                        /**
                                         *
                                         * @param pid 一级评论 ObjectId
                                         * @param puserId  一级评论的用户id
                                         * @param pusername 一级评论的用户名
                                         * @param commentUserId  回复评论userid
                                         * @param commentUsername  回复评论 用户名
                                         * @param attrId     景点id
                                         * @param attrTitle   景点标题
                                         * @param commentContent   评论内容
                                         * *
                                         */

                                        var reply = $(".comment_reply${p_index+1}")
                                        //var formObjectId = reply.data("formObjectId");
                                        var formObjectId = $(".re_reply").data("formObjectId");
                                        var commentUserId = reply.data("comment_id");
                                        var commentUsername = reply.data("comment_username");
                                        var attrId = reply.data("poi_id");
                                        var attrTitle = reply.data("poi_name");
                                        var pid = reply.data("parent_id");
                                        var puserId = reply.data("parent_uid");
                                        var pusername = reply.data("parent_username");
                                        var commentContent = reply.val();

                                        $.post("/attraction/commentReply",{formObjectId:formObjectId,commentContent:commentContent,commentUserId:commentUserId,commentUsername:commentUsername,
                                            attrId:attrId,attrTitle:attrTitle,pid:pid,puserId:puserId,pusername:pusername},function (data) {
                                            alert("评论成功");
                                            window.location.reload();
                                        })
                                    })
                                </script>
                            </div>
                        </li>
                        </#list>
    </ul>
</div>
<div style="float: right">
    <div style="float: left;" ><span style="line-height:30px"> 共${page.totalPages!}页 / ${page.totalElements}条&nbsp;&nbsp;&nbsp;</span></div>
    <div id="pagination" class="jq-pagination" style="display: inline;"></div>
</div>
<script>
    $("#pagination").jqPaginator({
        totalPages: ${page.totalPages!0},
        visiblePages: 5,
        currentPage: ${page.number+1}||1,
        prev: '<a class="prev" href="javascript:void(0);">上一页<\/a>',
        next: '<a class="next" href="javascript:void(0);">下一页<\/a>',
        page: '<a href="javascript:void(0);">{{page}}<\/a>',
        last: '<a class="last" href="javascript:void(0);" >尾页<\/a>',
        onPageChange: function(page, type) {
        if(type == 'change'){
            $("#searchType").val($(".nav-list a[class='on _j_search_link']").data("index"));
            $("#currentPage").val(page);
            $("#kwSearchForm").submit();
        }

    }
    })
</script>